home *** CD-ROM | disk | FTP | other *** search
/ Gold Medal Software 3 / Gold Medal Software - Volume 3 (Gold Medal) (1994).iso / spreads / 123exp.arj / WKS_FILE.INC < prev    next >
Text File  |  1993-12-15  |  7KB  |  132 lines

  1. !══════════════════════════════════════════════════════════════════════════════
  2. !   RED - 03/13/92
  3. !
  4. !   This defines the layout of a 1-2-3 spreadsheet file.  The 1-2-3 record
  5. !   opcode values and the variables needed to process a 1-2-3 file are also
  6. !   defined.
  7. !
  8. !══════════════════════════════════════════════════════════════════════════════
  9.  
  10. wks_file    DOS,NAME(wks_filename),PRE(wks)
  11. record      RECORD
  12. opcode          SHORT
  13. length          SHORT
  14. bof_info        GROUP
  15. version             SHORT
  16.                     GROUP;BYTE,DIM(2062).
  17.                 .
  18. window1_info    GROUP,OVER(bof_info)            ! Window #1 information
  19. cursor_col          SHORT                       ! Current cursor column
  20. cursor_row          SHORT                       !   and row
  21. cell_format         BYTE
  22.                     BYTE                        ! Unused (must be 0)
  23. w1_col_width        SHORT
  24. screen_cols         SHORT                       ! #of columns on screen
  25. screen_rows         SHORT                       ! #of rows on screen
  26. leftmost_col        SHORT
  27. top_row             SHORT
  28. title_cols          SHORT                       ! # of title columns
  29. title_rows          SHORT                       ! # of title rows
  30. left_ttl_col        SHORT                       ! Left title column number
  31. top_ttl_row         SHORT                       ! Top title row number
  32. br_width_col        SHORT                       ! Border width column
  33. br_width_row        SHORT                       ! Border width row
  34. window_width        SHORT                       ! Window width column
  35.                     BYTE                        ! Unused (must be 0)
  36.                     BYTE                        ! Pad to 32?
  37.                 .
  38. width_info      GROUP,OVER(bof_info)
  39. col_number          SHORT           ! A = 0
  40. col_width           BYTE
  41.                 .
  42. data            GROUP,OVER(bof_info)
  43. format              BYTE
  44. col                 SHORT           ! A = 0
  45. row                 SHORT           ! 1 = 0
  46.  
  47. label_info          GROUP
  48. label_prefix            STRING(1)
  49. string                  STRING(239)
  50.                         GROUP;BYTE,DIM(1818).
  51.                     .
  52. integer_info        GROUP,OVER(label_info)
  53. integer                 SHORT       ! 2-byte number - can only be a value
  54.                     .               !   from -32,768 to 32,767!
  55.  
  56. real_info           GROUP,OVER(label_info)
  57. real_no                 REAL        ! 8-byte (64-bit) floating point, IEEE format
  58.                     .
  59. formula_info        GROUP,OVER(label_info)
  60. result                  REAL        ! Formula result (64-bit, IEEE format)
  61. text_len                SHORT       ! Formula text size in bytes
  62. formula_text            GROUP;BYTE,DIM(2048).
  63. .           .   .   .
  64.  
  65. ! 1-2-3 Cell opcode values
  66. bof_op          SHORT(00)           ! Beginning of file
  67. window1_def     SHORT(07)           ! Window #1 definition (the main window)
  68. col_width_op    SHORT(08)           ! Set column width
  69. integer_op      SHORT(13)           ! Integer (0D00h, I/O automatically reverses)
  70. floating_op     SHORT(14)           ! Floating pointer (IEEE format, and Clarion!, format)
  71. label_op        SHORT(15)           ! Label record
  72. formula_op      SHORT(16)           ! Formula record
  73. cur_graph_op    SHORT(45)           ! Current graph record
  74. nam_graph_op    SHORT(46)           ! Named graph record
  75. def_range_op    SHORT(71)           ! Define range
  76. eof_op          SHORT(01)           ! End of file
  77.  
  78. ver_123_1       SHORT(1028)         ! Version 1.x spreadsheet
  79. ver_123_2       SHORT(1030)         ! Version 2.x spreadsheet
  80.  
  81. ! These format codes correspond to 1-2-3's format codes with cell
  82. !   protection on.
  83. def_format      BYTE(11111111b)     ! Use Default spreadsheet format
  84. cur_0_dec       BYTE(10100000b)     ! Currency, 0 decimal places
  85. cur_2_dec       BYTE(10100010b)     ! Currency, 2 decimal places
  86. comma_0_dec     BYTE(11000000b)     ! Comma, 0 decimal places
  87. comma_1_dec     BYTE(11000001b)     ! Comma, 1 decimal place
  88. comma_2_dec     BYTE(11000010b)     ! Comma, 2 decimal places
  89. comma_3_dec     BYTE(11000011b)     ! Comma, 3 decimal places
  90. comma_4_dec     BYTE(11000100b)     ! Comma, 4 decimal places
  91. comma_5_dec     BYTE(11000101b)     ! Comma, 5 decimal places
  92. comma_6_dec     BYTE(11000110b)     ! Comma, 6 decimal places
  93. date_intl_1     BYTE(11111001b)     ! Date, MM/DD/YY
  94. date_std        BYTE(11110010b)     ! Date, DD-MMM-YY
  95.  
  96. ! Turns off the "protected" cell bit when BANDed with the standard 1-2-3
  97. !   "protected cell" formats above.
  98. unprot_cell     BYTE(01111111b)
  99.  
  100. max_123_rows    SHORT(8192)         ! Maximum # of rows in a 1-2-3 spreadsheet
  101.  
  102. cnv_123_date    LONG(36161)         ! Subtract this variable from a standard
  103.                                     !   Clarion date field (LONG) to convert
  104.                                     !   it to the correct 1-2-3 date value.
  105. cnv_DBF_date    LONG(2378858)       ! Add this variable to a standard Clarion
  106.                                     !   date field (LONG) to convert it to the
  107.                                     !   correct dBase III/IV (.DBF) date value.
  108.                                     !   In Foxpro, use the SYS(11,xxx) function
  109.                                     !   to convert a date string to the DBF
  110.                                     !   format date number.
  111.                                     !   (ie. REPLACE ALL cla_date WITH VAL(SYS(11,char_date)) - 2378858
  112.  
  113. wks_filename    STRING(64)
  114. wks_number      REAL
  115. file_size       LONG                ! Size of the WKS file in bytes
  116. wks_pointer     LONG                ! Use as pointer variable for GETs
  117. org_pointer     LONG                ! Hold area for pointer value
  118. byte_cnt        BYTE                ! Number of bytes to read or write
  119. cur_row         SHORT
  120. cur_col         SHORT
  121. col_shown       SHORT               ! Column# currently displayed (use to
  122.                                     !   determine if the column letter display
  123.                                     !   needs to be updated.
  124. col_letters     GROUP               ! Column letter character values
  125. col_letter          BYTE,DIM(2)
  126.                 .
  127.  
  128. cell_typ_err   BYTE                 ! Set by read routines to indicate that the
  129.                                     !   expected cell type was not read (ie.
  130.                                     !   a label was found when a numeric cell
  131.                                     !   was required).
  132.